package my.jbf.firstGame.GAMEDATA;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import my.jbf.firstGame.R;


public class UserDBHelper extends SQLiteOpenHelper
{

    private static final int VERSION=1;
    private Context mContext;


    public UserDBHelper(Context context, String DBAddress)
    {
        super(context, DBAddress, null, VERSION);
        mContext = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db)
	{
        // TODO: Implement this method
        createPSWTable(db);

    }
    @Override
    public void onUpgrade(SQLiteDatabase p1, int p2, int p3)
    {
        // TODO: Implement this method
    }
    private void createPSWTable(SQLiteDatabase db)
    {
        // TODO: Implement this method
        String strSQL="create table if not exists " + mContext.getString(R.string.TableName_UserPSW)
			+ " (" + mContext.getString(R.string.USER_PSW_TID) + " integer primary key autoincrement, "
			+ mContext.getString(R.string.USER_PSW_UserName) + " text, "
			+ mContext.getString(R.string.USER_PSW_Password) + " text, "
			
			+ mContext.getString(R.string.USER_PSW_CreateTime) + " integer, "
			+ mContext.getString(R.string.USER_PSW_UserLastLoginTime) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameData1) + " text, "
			+ mContext.getString(R.string.USER_PSW_GameDataCreateTime1) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameDataLastLoginTime1) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameData2) + " text, "
			+ mContext.getString(R.string.USER_PSW_GameDataCreateTime2) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameDataLastLoginTime2) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameData3) + " text, "
			+ mContext.getString(R.string.USER_PSW_GameDataCreateTime3) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameDataLastLoginTime3) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameData4) + " text, "
			+ mContext.getString(R.string.USER_PSW_GameDataCreateTime4) + " integer, "
			+ mContext.getString(R.string.USER_PSW_GameDataLastLoginTime4) + " integer)";
			



        db.execSQL(strSQL);

    }
}
